home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / commodity / modepro / installmodepro < prev    next >
Text File  |  1997-05-18  |  7KB  |  199 lines

  1. ; Install script for ModePro
  2.  
  3.  
  4. ( set ModePro "ModePro")
  5. ( set ModeProPrefs "ModeProPrefs")
  6.  
  7. ;-------------------------------------------------------------
  8. ( set Yes "Yes")
  9. ( set No  "No")
  10.  
  11. ;-------------------------------------------------------------
  12. ( set Def_DaemonPath_WB      ( expandpath "Sys:WBStartup/" ) )
  13. ( set Def_DaemonPath_COM     ( expandpath "Sys:Tools/Commodities/" ) )
  14. ( set Def_PrefsPath          ( expandpath "Sys:Prefs/" ) )
  15.  
  16. ;-------------------------------------------------------------
  17. ( set AskAutoRunMP      "Automatically run ModePro when the computer boots?" )
  18. ( set AskAutoRunMPHelp  "HHHEEELLLPPPP!!!!" )
  19.  
  20.  
  21. ;-------------------------------------------------------------
  22. ( set AskStartHow               "How would you like ModePro started?\nPress 'Help' for more info.")
  23. ( set OptStartWBStartup         "Put ModePro in the WBStartup drawer")
  24. ( set OptStartUserStartup       "Start ModePro in the Startup-Sequence")
  25. ( set AskStartHowHelp           "ModePro can be started automatically on bootup two ways.  The simplest method is by placing ModePro in the WBStartup drawer.  The second way is to run ModePro from the s:User-Startup file, doing so allows ModePro to promote the Workbench screen." )
  26.  
  27. ;-------------------------------------------------------------
  28. ( set AskPrefsPath      "ModeProPrefs allows you to edit ModePro's promotion options.  Where would you like to put the preferences editor?" )
  29. ( set AskPrefsPathHelp  ("Generally this should be in the %s drawer." Def_PrefsPath) )
  30. ( set AskDaemonPath     "This is the suggested path for ModePro.  Change it if you wish." ) 
  31.  
  32. ;-------------------------------------------------------------
  33. ( set ToolTypeOptions  "Various options" )
  34.  
  35. ( set AskCxPopKey    "Enter the hotkey that pops up the preferences interface." )
  36. ( set AskCxPri       "Enter the value of ModePro's commodity priority." )  
  37. ( set AskCxPopup     "Would you like ModePro to popup the interface each time it is started.")
  38.  
  39. ;-----------------------------------------------------------------------
  40. ( set IM        "Installing ModePro...")
  41.  
  42. ( set AskLang   "ModePro features a localized interface.  Which languages would you like to install  A few catalogs are not complete.")
  43. ( set OptLangDeutsch   "deutsch  (mostly complete)" )
  44. ( set OptLangFrancais  "français (mostly complete)" )
  45. ( set OptLangIslenska  "íslenska (not complete)" )
  46. ( set OptLangNorsk     "norsk" )
  47. ( set OptLangPolski    "polski"   )
  48. ;and the directoies
  49. ( set OptLangDirDeutsch   "deutsch" )
  50. ( set OptLangDirFrancais  "français" )
  51. ( set OptLangDirIslenska  "íslenska" )
  52. ( set OptLangDirNorsk     "norsk" )
  53. ( set OptLangDirPolski    "polski"   )
  54.  
  55.  
  56. ( set SrcCatPath "catalogs/%s" )
  57. ( set DestCatPath "locale:catalogs/%s" )
  58.  
  59. ;-----------------------------------------------------------------------
  60.  
  61. ( set AskModifyUS     "The options you have chosen require the s:user-startup file to be modified." )
  62. ( set AskModifyUSHelp "The options you have chosen require the s:user-startup file to be modified." )
  63.  
  64.  
  65. ;-------- BEGIN ----------
  66.  
  67. ( set AutoRun ( askbool (prompt  AskAutoRunMP ) 
  68.                         (help    AskAutoRunMPHelp ) 
  69.                         (default 0) 
  70.               )  
  71. )
  72.  
  73. ( if AutoRun 
  74.     (
  75.         ( set AutoHow ( askchoice (prompt   AskStartHow)
  76.                                   (help     AskStartHowHelp)
  77.                                   (choices  OptStartWBStartup OptStartUserStartup)
  78.                                   (default  1)
  79.                        )
  80.         )
  81.         ( if AutoHow
  82.             (
  83.                 (set daemonpath Def_DaemonPath_COM)
  84.             )
  85.             (
  86.                 (set daemonpath Def_DaemonPath_WB)
  87.             )
  88.         )   
  89.     )
  90.     (
  91.         (set daemonpath Def_DaemonPath_COM)
  92.     )
  93. )
  94.  
  95. (set daemonpath ( askdir (prompt AskDaemonPath)
  96.                           (help "Cow")
  97.                           (default daemonpath)
  98. ) )
  99.  
  100. (set prefspath ( askdir (prompt  AskPrefsPath)
  101.                                (help    AskPrefsPathHelp)
  102.                                (default Def_PrefsPath)
  103.                       ) 
  104. )
  105.  
  106. ( set ModeProPrefsCommand ( tackon ( prefspath) 
  107.                                    ( "ModeProPrefs") 
  108.                           ) 
  109. )
  110.  
  111. ( set cxpopkey ( askstring  (prompt AskCxPopKey)
  112.                             (help "None")
  113.                             (default "lcommand p")
  114.                )
  115. )
  116.  
  117. ( set cxpri ("%ld" (asknumber  (prompt AskCxPri)
  118.                                (help "None")
  119.                                (default 5)
  120.                    )
  121.             )
  122. )
  123.  
  124. ( set cxpopup  ( askbool (prompt  AskCxPopup)
  125.                          (help    "None" )
  126.                ) 
  127. )
  128.  
  129. ;-Set the tooltypes----------------------------------------------------
  130.  
  131. (tooltype (dest ModePro)
  132.           (settooltype "CX_POPKEY" cxpopkey)
  133.           (settooltype "CX_POPUP" (select cxpopup No Yes) )
  134.           (settooltype "CX_PRIORITY" cxpri )
  135.           (settooltype "PREFSCOMMAND" ModeProPrefsCommand)
  136. )
  137.  
  138. ;--------------------------------------------------------------
  139.  
  140. (copyfiles (prompt IM)
  141.            (help "Why did you do that?")
  142.            (source ModePro)
  143.            (infos)
  144.            (dest daemonpath)
  145. )
  146.  
  147. (set @default-dest daemonpath)
  148.  
  149. (copyfiles (prompt IM)
  150.            (help "Hey, what are you doing?")
  151.            (source ModeProPrefs)
  152.            (infos)
  153.            (dest prefspath)
  154. )
  155.  
  156. (if (AND AutoRun AutoHow)
  157.     ( 
  158.         (startup "ModePro"
  159.                  (prompt  AskModifyUS )
  160.                  (help    AskModifyUSHelp )
  161.                  (command (cat "Run <>NIL: ModePro" ) )
  162.         )
  163.     )
  164.     (
  165.        (startup "ModePro"
  166.                  (prompt  AskModifyUS )
  167.                  (help    AskModifyUSHelp )
  168.                  (command ";Don't run ModePro from User-Startup")
  169.   
  170.         )
  171.     )
  172. )
  173.  
  174. (set WhichLang (askoptions (prompt AskLang)
  175.                            (help AskLang)
  176.                            (choices OptLangDeutsch OptLangFrancais OptLangIslenska OptLangNorsk OptLangPolski)
  177.                            (default 0) 
  178. )              )
  179.  
  180. (set optnumber 0)
  181.  
  182. ( while ( < optnumber 5 )
  183.   (set flag (BITAND (shiftright WhichLang optnumber) 1) )
  184.   (debug optnumber flag)
  185.   (if flag
  186.     (
  187.       (set lang     ( select optnumber OptLangDirDeutsch OptLangDirFrancais OptLangDirIslenska OptLangDirNorsk OptLangDirPolski) )
  188.       (debug lang)
  189.       (set srcpath ( SrcCatPath  lang ) )
  190.       (debug srcpath)
  191.       (set dstpath ( DestCatPath lang ) )
  192.       (debug dstpath) 
  193.       (makedir dstpath)
  194.       (copyfiles  (prompt IM) (help "Why did you do that?") (source srcpath) (dest dstpath) (all) )
  195.     )
  196.   )
  197.   (set optnumber (+ optnumber 1) )
  198. )
  199.